﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QueueSimulator
{
    public class Event : IComparable
    {
        public EventType Type { get; set; }
        public double Time { get; set; }
        public bool Done { get; set; }

        public Event(EventType type, double time)
        {
            Type = type;
            Time = time;
            Done = false;
        }

        #region IComparable Members

        public int CompareTo(object obj)
        {
            var e = obj as Event;

            if (e != null)
            {
                if (this.Time < e.Time)
                    return -1;
                else if (this.Time > e.Time)
                    return 1;
                else return 0;
            }

            throw new ArgumentException();
        }

        #endregion
    }
}
